package com.spring.ioc.entity;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Person {
    @Value("999")
    private Long id;
    @Value("tomdragon")
    private String name;

    /**
     * 演示：注入
     * @return
     */
    @Autowired
    private Pet pet;

    public void call() {
        pet.move();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
